package com.runen.wnhz.runen.ui.adapter.puadapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.runen.wnhz.runen.R;
import com.runen.wnhz.runen.data.entity.ReceivingAddressEntity;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

public class ReceiveAddressRecyclerAdapter extends RecyclerView.Adapter<com.runen.wnhz.runen.ui.adapter.puadapter.ReceiveAddressRecyclerAdapter.ViewHolder> {

    private List<ReceivingAddressEntity> mlist;

    private Context context;

    public ReceiveAddressRecyclerAdapter(List<ReceivingAddressEntity> mlist, Context context) {
        this.mlist = mlist;
        this.context = context;
    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = View.inflate(context, R.layout.receiving_address_item,null);
        com.runen.wnhz.runen.ui.adapter.puadapter.ReceiveAddressRecyclerAdapter.ViewHolder viewHolder = new com.runen.wnhz.runen.ui.adapter.puadapter.ReceiveAddressRecyclerAdapter.ViewHolder(view);
        return viewHolder;
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {

    }

    @Override
    public int getItemCount() {
        if(mlist != null){
            return mlist.size();
        }else {
            return 0;
        }
    }

    class ViewHolder extends RecyclerView.ViewHolder{

        @BindView(R.id.tv_user_name)
        TextView tv_user_name;
        @BindView(R.id.tv_user_phone)
        TextView tv_user_phone;
        @BindView(R.id.tv_user_address)
        TextView tv_user_address;
        @BindView(R.id.tv_default)
        TextView tv_default;
        @BindView(R.id.tv_delete)
        TextView tv_delete;
        @BindView(R.id.tv_edit)
        TextView tv_edit;


        public ViewHolder(View itemView) {
            super(itemView);
            ButterKnife.bind(this,itemView);
        }
    }
}
